getParentActivityIntent

@Nullable
open fun getParentActivityIntent(@NonNull sourceActivity: @NonNull Activity): @Nullable Intent(source)

Obtain an Intent that will launch an explicit target activity specified by sourceActivity's PARENT_ACTIVITY element in the application's manifest. The android:parentActivityName attribute will be preferred if it is present.

Return

a new Intent targeting the defined parent activity of sourceActivity

Parameters

sourceActivity

Activity to fetch a parent intent for


@Nullable
open fun getParentActivityIntent(@NonNull context: @NonNull Context, @NonNull sourceActivityClass: @NonNull Class<out Any>): @Nullable Intent(source)

Obtain an Intent that will launch an explicit target activity specified by sourceActivityClass's PARENT_ACTIVITY element in the application's manifest.

Return

a new Intent targeting the defined parent activity of sourceActivity

Parameters

context

Context for looking up the activity component for sourceActivityClass

sourceActivityClass

java.lang.Class object for an Activity class

Throws

if the ComponentName for sourceActivityClass is invalid


@Nullable
open fun getParentActivityIntent(@NonNull context: @NonNull Context, @NonNull componentName: @NonNull ComponentName): @Nullable Intent(source)

Obtain an Intent that will launch an explicit target activity specified by sourceActivityClass's PARENT_ACTIVITY element in the application's manifest.

Return

a new Intent targeting the defined parent activity of sourceActivity

Parameters

context

Context for looking up the activity component for the source activity

componentName

ComponentName for the source Activity

Throws

if the ComponentName for sourceActivityClass is invalid